/*
 * @Description: 登录入口
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2021-07-12 11:31:28
 * @LastEditTime: 2021-12-23 21:14:18
 */
import { createApp } from 'vue'
import moment from 'moment'
import Antd from 'ant-design-vue'
import store from '@/store'
import router from './router'
import setTenant from '@/plugins/setTenant'
import { i18n, LocaleEnum } from '@/locales'
import { client } from '@/utils'
import App from './app.vue'

const LOCALE_TO_MOMENT = {
	[LocaleEnum.zh]: 'zh-cn',
	[LocaleEnum.en]: 'en',
	[LocaleEnum.ja]: 'ja',
}
moment.locale(LOCALE_TO_MOMENT[i18n.locale as LocaleEnum])
const app = createApp(App).use(i18n).use(router).use(store).use(Antd)
;(async () => {
	await setTenant.install(app, client.isPc() ? 'desktop' : 'mobile')
	app.mount('#app')
})()
